home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / rexx / funnytalk.rexx < prev    next >
OS/2 REXX Batch file  |  1998-06-04  |  7KB  |  162 lines

  1. /*****************************************************/
  2. /*                                                   */
  3. /* Funnytalk.rexx                                    */
  4. /*  for EvenMore - Copyright Chris Perver @1996-1998 */
  5. /*                                                   */
  6. /****************************************************/
  7.  
  8. address 'EvenMore.1'
  9.  
  10. options results
  11. "GETFILENAME"
  12. filename = RESULT
  13. "GETTOTALLINES"
  14. totlines = RESULT
  15.  
  16. If Open(file,'Ram:'filename,'W') then
  17.   do
  18.  
  19.     line = 1
  20.     do while line<totlines
  21.       "GETLINE "line
  22.       text = RESULT
  23.       if text~='' then
  24.         do
  25.           text = rude(text)
  26.         end
  27.       Call Writeln(file, text)
  28.       line = line + 1
  29.       say totlines - line
  30.     end
  31.     Call Close(file)
  32.   end
  33.  
  34. "LOAD Ram:"filename
  35. exit
  36.  
  37. rude:
  38.   parse var text
  39.   if random(1,4,time('S'))=1 then
  40.   do
  41.     pos=pos('!',text,random(1,length(text),time('S')))
  42.     if pos>0 then text=insert('. So there',text,pos-1)
  43.   end
  44.   if random(1,4,time('S'))=1 then
  45.   do
  46.     pos=pos('?',text,random(1,length(text),time('S')))
  47.     if pos>0 then text=insert(', ok mate',text,pos-1)
  48.   end
  49.   if random(1,4,time('S'))=1 then
  50.   do
  51.     pos=pos('. ',text,random(1,length(text),time('S')))
  52.     if pos>0 then text=insert('. ''S coo'', bro',text,pos-1)
  53.   end
  54.   if random(1,4,time('S'))=1 then
  55.   do
  56.     pos=pos('. ',text,random(1,length(text),time('S')))
  57.     if pos>0 then text=insert('. What it is, mama',text,pos-1)
  58.   end
  59.   if random(1,4,time('S'))=1 then
  60.   do
  61.     pos=pos('. ',text,random(1,length(text),time('S')))
  62.     if pos>0 then text=insert('. Ah be baaad',text,pos-1)
  63.   end
  64.   /* space around words to ensure we are dealing with a whole word */
  65.   /* or else sounds have to be compatible with every phrase        */
  66.  
  67.   text=wordcheck(' hello | yo ')               /* hello         */
  68.   text=wordcheck(' isn''t | ain''t ')          /* isn't         */
  69.   text=wordcheck(' a | some ')                 /* a             */
  70.   text=wordcheck(' are | is ')                 /* are           */
  71.   text=wordcheck(' is | be ')                  /* is            */
  72.   text=wordcheck(' name | dojigger ')          /* name          */
  73.   text=wordcheck(' today | the ''savo ')       /* today         */
  74.   text=wordcheck(' you | ya'' ')               /* you           */
  75.   text=wordcheck(' you all | yall ')           /* you all       */
  76.   text=wordcheck(' it is | ''tis ')            /* it is         */
  77.   text=wordcheck(' yes | yep ')                /* yes           */
  78.   text=wordcheck(' no | nah ')                 /* no            */
  79.   text=wordcheck(' to | t''')                  /* to            */
  80.   text=wordcheck(' that | t''at ')             /* that          */
  81.   text=wordcheck(' just | but ')               /* just          */
  82.   text=wordcheck(' mother | ma ')              /* mother        */
  83.   text=wordcheck(' woman | mama ')             /* woman         */
  84.   text=wordcheck(' man | dude ')               /* man           */
  85.   text=wordcheck(' father | pa ')              /* father        */
  86.   text=wordcheck(' sister | sis'' ')           /* sister        */
  87.   text=wordcheck(' friend | homey ')           /* friend        */
  88.   text=wordcheck(' my | mah'' ')               /* my            */
  89.   text=wordcheck(' we | us ')                  /* we            */
  90.   text=wordcheck(' am | be ')                  /* am            */
  91.   text=wordcheck(' i | ah'' ')                 /* i             */
  92.   text=wordcheck(' man | dude ')               /* man           */
  93.   text=wordcheck(' one | un'' ')               /* one           */
  94.   text=wordcheck(' beat | whup'' ')            /* beat          */
  95.   text=wordcheck(' dead | deed ')              /* dead          */
  96.   text=wordcheck(' dead | beat ')              /* dead          */
  97.   text=wordcheck(' dead | gone ')              /* dead          */
  98.   text=wordcheck(' big | hefty ')              /* big           */
  99.   text=wordcheck(' big | huge ')               /* big           */
  100.   text=wordcheck(' large | goofy ')            /* large         */
  101.   text=wordcheck(' large | lanky ')            /* large         */
  102.   text=wordcheck(' small | wee ')              /* small         */
  103.   text=wordcheck(' small | shrimp ')           /* small         */
  104.   text=wordcheck(' Windows95 | Windoof95 ')    /* Windows95     */
  105.   text=wordcheck(' Windows95 | Winblows95 ')   /* Windows95     */
  106.   text=wordcheck(' Windows95 | Windoze95 ')    /* Windows95     */
  107.   text=wordcheck(' MSDos | MSDog ')            /* MSDos         */
  108.   text=wordcheck(' MicroSoft | MicroSmell ')   /* Microsoft     */
  109.   text=wordcheck(' MicroSoft | MicroSh*t ')    /* Microsoft     */
  110.   text=wordcheck(' MicroSoft | MicroSick ')    /* Microsoft     */
  111.   text=wordcheck(' MicroSoft | MicroSlick ')   /* Microsoft     */
  112.   text=wordcheck(' MicroSoft | MicroSloth ')   /* Microsoft     */
  113.   text=wordcheck(' any | no ')                 /* any           */
  114.   text=wordcheck(' of | uh ')                  /* of            */
  115.   text=wordcheck(' the | da ')                 /* the           */
  116.   text=wordcheck(':|, dig dis:')               /* :             */
  117.   text=wordcheck(' up | down ')                /* up            */
  118.   text=wordcheck(' down | waay down ')         /* down          */
  119.   text=wordcheck(' sure | sho'' nuff ')        /* sure          */
  120.   text=wordcheck(' sort of | radical ')        /* sort of       */
  121.   text=wordcheck(' have | gots'' ')            /* have          */
  122.   text=wordcheck(' money | bre''d ')           /* money         */
  123.   text=wordcheck(' cash | bre''d ')            /* money         */
  124.   text=wordcheck(' very | real ')              /* very          */
  125.  
  126.   text=wordcheck('tion|shun')                  /* tion words    */
  127.   text=wordcheck('er |a'' ')                   /* er words      */
  128.   text=wordcheck('ing |in'' ')                 /* ing words     */
  129.   text=wordcheck('ork|urk')                    /* ork words     */
  130.   text=wordcheck('ork|erk')                    /* ork words     */
  131.   text=wordcheck('or|o''')                     /* or words      */
  132.   text=wordcheck('of|o''')                     /* of words      */
  133.   text=wordcheck('o |o''s ')                   /* o  words      */
  134.   text=wordcheck('th|d')                       /* th words      */
  135.   text=wordcheck('th|v')                       /* th words      */
  136.   text=wordcheck('e |es ')                     /* e words       */
  137.   text=wordcheck('s |sh ')                     /* s words       */
  138.   text=wordcheck(' ca| ki')                    /* ca words      */
  139.   text=wordcheck('tt|tst')                     /* tt words      */
  140.   text=wordcheck('tch|sh')                     /* tch words     */
  141.   text=wordcheck('ai|e')                       /* ai words      */
  142.   text=wordcheck('ou|u')                       /* ou words      */
  143.   text=wordcheck('ight|ite')                   /* ight words    */
  144.   text=wordcheck(' su| schu')                  /* su words      */
  145.   text=wordcheck('at |ut ')                    /* at words      */
  146.   text=wordcheck('as |uz ')                    /* as words      */
  147.   text=wordcheck('oes|uz')                     /* oes words     */
  148. return text
  149.  
  150. wordcheck:
  151.   parse arg oldword'|'newword
  152.   stringpos=pos(Upper(oldword),Upper(text))
  153.   do while stringpos>0
  154.     if random(1,2,time('S'))=1 then
  155.     do
  156.       text=delstr(text,stringpos,length(oldword))
  157.       text=insert(newword,text,stringpos-1)
  158.     end
  159.     stringpos=pos(Upper(oldword),Upper(text),stringpos+length(newword))
  160.   end
  161. return text
  162.